/*
    RoleCall provides a web service that web applications can use to find 
    the roles associated with a user that has been authenticated via OpenID. 
    Also provides a web-based user interface to manage the user roles 
    associated with partner web applications.
    
    Development of this software was supported in part by the David and Lucile 
    Packard Foundation and by the the Office Of Naval Research (ONR) 
     
    Copyright (c) 2012, 
    Monterey Bay Aquarium Research Institute - MBARI ( www.mbari.org )
    Michael Godin ( mikegodin AT users DOT sourceforge DOT net )

    RoleCall is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    RoleCall is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar (see the file COPYING.GPL).  If not, see 
    <http://www.gnu.org/licenses/>.  
*/

package org.mbari.rolecall.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

/**
 * Provider, used to list OpenID providers used to log into RoleCall itself
 * Initially populated with Google and Yahoo
 * 
 * @author godin
 * 
 */
@SuppressWarnings("serial")
@Entity(name = Provider.TABLE_NAME)
public class Provider implements Serializable {

    public static final String FIELD_NAME_FAVICON_URL = "favion_url";

    public static final String FIELD_NAME_NAME = "name";

    public static final String FIELD_NAME_PROMPT = "prompt";

    public static final String FIELD_NAME_URL = "url";

    public static final String TABLE_NAME = "Provider";

    @Column(name = FIELD_NAME_FAVICON_URL)
    protected String faviconURL;

    @Id
    @GeneratedValue
    protected int id;

    @Column(name = FIELD_NAME_NAME)
    protected String name;

    @Column(name = FIELD_NAME_PROMPT)
    protected String prompt;

    @Column(name = FIELD_NAME_URL)
    protected String url;

    // No-arg constructor with at package visibility for persistence
    Provider() {
    }

    public Provider(String name, String faviconURL, String url, String prompt) {
        super();
        this.name = name;
        this.url = url;
        this.prompt = prompt;
        this.faviconURL = faviconURL;
    }

    /**
     * @return the faviconURL
     */
    public String getFaviconURL() {
        return faviconURL;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the prompt
     */
    public String getPrompt() {
        return prompt;
    }

    /**
     * @return the url
     */
    public String getUrl() {
        return url;
    }

    /**
     * @param faviconURL
     *            the faviconURL to set
     */
    public void setFaviconURL(String faviconURL) {
        this.faviconURL = faviconURL;
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param prompt
     *            the prompt to set
     */
    public void setPrompt(String prompt) {
        this.prompt = prompt;
    }

    /**
     * @param url
     *            the url to set
     */
    public void setUrl(String url) {
        this.url = url;
    }

}
